﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tracy.DataModel;
using System.IO;
using System.Xml;
using SharedLib.Helpers;

namespace Tracy.DataServices
{
    public class EntryProvider : SharedLib.DataAccess.XmlDataProvider <Entry>
    {

        public Entry GetItemByName(string name)
        {
            XmlNode node = doc.SelectSingleNode(String.Format("entries/entry[@name='{0}']", name));
            if (node == null) return null;
            return new Entry(node);
        }

        public override string FileName
        {
            get { return "Entries.xml"; }
        }

        public override string RootNodeName
        {
            get { return "entries"; }
        }

        public override string DataItemPath
        {
            get { return "entries/entry"; }
        }
    }
}
